package com.test.dynamicproxy;

import java.lang.reflect.Proxy;

/**
 * Created by jl on 2016/5/21.
 */
public class Demo {
    public static void main(String[] args) {
        RealSubject real = new RealSubject();
        Subject proxySubject = (Subject) Proxy.newProxyInstance(Subject.class.getClassLoader(), new Class[]{Subject.class}, new ProxyHandler(real));
        proxySubject.doSomething();
    }
}
